package apiday02;

public class SplitDemo13 {
    public static void main(String[] args) {
        /*
         *劈开IP地址，     .的坑
         */
/*        String str = "192.168.1.1";
        String[] arr = str.split("\\.");//劈开.需要用转义\\.
        for (int i = 0; i < arr.length; i++) {
            System.out.println(arr[i]);
        }*/

        String str = "boo:and:foo";
        String[] arr = str.split("o");//结果{“b”，“”，“:and:f”}
        for (int i = 0; i < arr.length; i++) {
            System.out.println(arr[i]);
        }


    }
}
